//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

%module nelmisc
%typemap(jni)           jsint8 "jsint8"
%typemap(jtype)         jsint8 "byte"
%typemap(jstype)        jsint8 "byte"
%typemap(jni)           juint8 "juint8"
%typemap(jtype)         juint8 "byte"
%typemap(jstype)        juint8 "byte"

%include "std_deque.i"
//%include "std_list.i"
%include "std_map.i"
%include "std_pair.i"
//%include "std_set.i"
%include "std_string.i"
%include "std_vector.i"

// Deal with method name conflicts
%rename(toString_c) *::toString() const;
// java conflict
#ifdef SWIGJAVA
        %rename(wait_c) *::wait();
        %rename(clone_c) *::clone() const;
#endif

%rename(assign) *::operator=;
%rename(isEqual) *::operator==;
%rename(notEqual) *::operator!=;
%rename(access) *::operator();
%rename(gt) *::operator>;
%rename(gte) *::operator>=;
%rename(lt) *::operator<;
%rename(lte) *::operator<=;
%rename(mul) *::operator*;
%rename(mulSelf) *::operator*=;
%rename(sub) *::operator-;
%rename(subSelf) *::operator-=;
%rename(add) *::operator+;
%rename(addSelf) *::operator+=;
%rename(div) *::operator/;
%rename(divSelf) *::operator/=;

%feature("abstract") NLMISC::IRunnable;
%feature("abstract") NLMISC::IRunnablePos;
%feature("abstract") NLMISC::IProcess;
%feature("abstract") *::ITHread;
%feature("abstract") NLMISC::IStream;
%feature("abstract") IInputDevice;
%feature("abstract") ILoadProxy;
%feature("abstract") *::ICancelCallback;
%feature("abstract") *::IChangeTaskPriority;

%ignore NLMISC::IRunnablePos::IRunnablePos();
%ignore NLMISC::CImposterLog::CImposterLog(TAccessor accessor);
// Ignore broken ryzom-core API
%ignore NLMISC::CFpuChecker;
%ignore NLMISC::CFileContainer::makePathRelative;
%ignore NLMISC::DebugNeedAssert;
%ignore NLMISC::NoAssert;
%ignore NLMISC::report;
%ignore NLMISC::CStringStream::serialSeparatedBufferIn;
%ignore NLMISC::CStringStream::serialSeparatedBufferOut;
%ignore NLMISC::enterBreakpoint;
%ignore NLMISC::CStringStream::CStringStream;

%{
#include "nel/misc/quad.h"
#include "nel/misc/quat.h"
#include "nel/misc/aabbox.h"
#include "nel/misc/algo.h"
#include "nel/misc/app_context.h"
#include "nel/misc/array_2d.h"
#include "nel/misc/async_file_manager.h"
#include "nel/misc/big_file.h"
#include "nel/misc/bit_mem_stream.h"
#include "nel/misc/bit_set.h"
#include "nel/misc/bitmap.h"
#include "nel/misc/block_memory.h"
#include "nel/misc/bsphere.h"
#include "nel/misc/buf_fifo.h"
#include "nel/misc/check_fpu.h"
#include "nel/misc/class_id.h"
#include "nel/misc/class_registry.h"
#include "nel/misc/cmd_args.h"
#include "nel/misc/co_task.h"
#include "nel/misc/command.h"
#include "nel/misc/common.h"
#include "nel/misc/config_file.h"
#include "nel/misc/contiguous_block_allocator.h"
#include "nel/misc/cpu_time_stat.h"
#include "nel/misc/debug.h"
#include "nel/misc/di_event_emitter.h"
//#include "nel/misc/diff_tool.h"
#include "nel/misc/displayer.h"
#include "nel/misc/dummy_window.h"
#include "nel/misc/dynloadlib.h"
#include "nel/misc/eid_translator.h"
#include "nel/misc/entity_id.h"
#include "nel/misc/enum_bitset.h"
#include "nel/misc/eval_num_expr.h"
#include "nel/misc/event_emitter.h"
#include "nel/misc/event_emitter_multi.h"
#include "nel/misc/event_listener.h"
#include "nel/misc/event_server.h"
//#include "nel/misc/events.h"
#include "nel/misc/factory.h"
#include "nel/misc/fast_floor.h"
#include "nel/misc/fast_mem.h"
#include "nel/misc/file.h"
#include "nel/misc/fixed_size_allocator.h"
#include "nel/misc/game_device.h"
//#include "nel/misc/game_device_events.h"
#include "nel/misc/geom_ext.h"
#include "nel/misc/grid_traversal.h"
#include "nel/misc/gtk_displayer.h"
#include "nel/misc/heap_memory.h"
#include "nel/misc/hierarchical_timer.h"
#include "nel/misc/historic.h"
#include "nel/misc/i18n.h"
#include "nel/misc/i_xml.h"
#include "nel/misc/input_device.h"
#include "nel/misc/input_device_manager.h"
#include "nel/misc/input_device_server.h"
#include "nel/misc/inter_window_msg_queue.h"
#include "nel/misc/keyboard_device.h"
#include "nel/misc/line.h"
#include "nel/misc/log.h"
#include "nel/misc/matrix.h"
#include "nel/misc/md5.h"
#include "nel/misc/mem_displayer.h"
#include "nel/misc/mem_stream.h"
#include "nel/misc/mouse_device.h"
#include "nel/misc/mouse_smoother.h"
#include "nel/misc/mutable_container.h"
#include "nel/misc/mutex.h"
#include "nel/misc/noise_value.h"
#include "nel/misc/o_xml.h"
#include "nel/misc/object_arena_allocator.h"
#include "nel/misc/object_vector.h"
#include "nel/misc/p_thread.h"
#include "nel/misc/path.h"
#include "nel/misc/plane.h"
#include "nel/misc/plane_inline.h"
#include "nel/misc/polygon.h"
#include "nel/misc/pool_memory.h"
#include "nel/misc/progress_callback.h"
#include "nel/misc/random.h"
#include "nel/misc/reader_writer.h"
#include "nel/misc/rect.h"
#include "nel/misc/report.h"
#include "nel/misc/resource_ptr.h"
#include "nel/misc/resource_ptr_inline.h"
#include "nel/misc/rgba.h"
#include "nel/misc/sha1.h"
#include "nel/misc/shared_memory.h"
#include "nel/misc/sheet_id.h"
#include "nel/misc/singleton.h"
#include "nel/misc/smart_ptr.h"
#include "nel/misc/smart_ptr_inline.h"
#include "nel/misc/speaker_listener.h"
#include "nel/misc/sstring.h"
#include "nel/misc/static_map.h"
#include "nel/misc/stl_block_allocator.h"
#include "nel/misc/stl_block_list.h"
#include "nel/misc/stop_watch.h"
#include "nel/misc/stream.h"
#include "nel/misc/stream_inline.h"
#include "nel/misc/string_common.h"
#include "nel/misc/string_conversion.h"
#include "nel/misc/string_id_array.h"
#include "nel/misc/string_mapper.h"
#include "nel/misc/string_stream.h"
#include "nel/misc/system_info.h"
#include "nel/misc/system_utils.h"
#include "nel/misc/task_manager.h"
#include "nel/misc/tds.h"
#include "nel/misc/thread.h"
#include "nel/misc/time_nl.h"
#include "nel/misc/timeout_assertion_thread.h"
#include "nel/misc/traits_nl.h"
#include "nel/misc/triangle.h"
#include "nel/misc/twin_map.h"
//#include "nel/misc/types_nl.h"
#include "nel/misc/ucstring.h"
#include "nel/misc/uv.h"
#include "nel/misc/value_smoother.h"
#include "nel/misc/variable.h"
#include "nel/misc/vector.h"
#include "nel/misc/vector_2d.h"
#include "nel/misc/vector_2f.h"
#include "nel/misc/vector_h.h"
#include "nel/misc/vector_inline.h"
#include "nel/misc/vectord.h"
#include "nel/misc/vectord_inline.h"
#include "nel/misc/win32_util.h"
#include "nel/misc/win_displayer.h"
#include "nel/misc/win_event_emitter.h"
#include "nel/misc/win_thread.h"
#include "nel/misc/win_tray.h"
#include "nel/misc/window_displayer.h"
#include "nel/misc/words_dictionary.h"
#include "nel/misc/xml_pack.h"

using namespace NLMISC;
typedef std::string::size_type size_type;
typedef NLMISC::IStream::TSeekOrigin TSeekOrigin;

%}
%include "compat.h"

%include "nel/misc/quad.h"
%include "nel/misc/quat.h"
%include "nel/misc/aabbox.h"
%include "nel/misc/algo.h"
%include "nel/misc/app_context.h"
%include "nel/misc/array_2d.h"
%include "nel/misc/async_file_manager.h"
%include "nel/misc/big_file.h"
%include "nel/misc/bit_mem_stream.h"
%include "nel/misc/bit_set.h"
%include "nel/misc/bitmap.h"
%include "nel/misc/block_memory.h"
%include "nel/misc/bsphere.h"
%include "nel/misc/buf_fifo.h"
%include "nel/misc/check_fpu.h"
%include "nel/misc/class_id.h"
%include "nel/misc/class_registry.h"
%include "nel/misc/cmd_args.h"
%include "nel/misc/co_task.h"
%include "nel/misc/command.h"
%include "nel/misc/common.h"
%include "nel/misc/config_file.h"
%include "nel/misc/contiguous_block_allocator.h"
%include "nel/misc/cpu_time_stat.h"
%include "nel/misc/debug.h"
%include "nel/misc/di_event_emitter.h"
//%include "nel/misc/diff_tool.h"
%include "nel/misc/displayer.h"
%include "nel/misc/dummy_window.h"
%include "nel/misc/dynloadlib.h"
%include "nel/misc/eid_translator.h"
%include "nel/misc/entity_id.h"
%include "nel/misc/enum_bitset.h"
%include "nel/misc/eval_num_expr.h"
%include "nel/misc/event_emitter.h"
%include "nel/misc/event_emitter_multi.h"
%include "nel/misc/event_listener.h"
%include "nel/misc/event_server.h"
//%include "nel/misc/events.h"
%include "nel/misc/factory.h"
%include "nel/misc/fast_floor.h"
%include "nel/misc/fast_mem.h"
%include "nel/misc/file.h"
%include "nel/misc/fixed_size_allocator.h"
%include "nel/misc/game_device.h"
//%include "nel/misc/game_device_events.h"
%include "nel/misc/geom_ext.h"
%include "nel/misc/grid_traversal.h"
%include "nel/misc/gtk_displayer.h"
%include "nel/misc/heap_memory.h"
%include "nel/misc/hierarchical_timer.h"
%include "nel/misc/historic.h"
%include "nel/misc/i18n.h"
%include "nel/misc/i_xml.h"
%include "nel/misc/input_device.h"
%include "nel/misc/input_device_manager.h"
%include "nel/misc/input_device_server.h"
%include "nel/misc/inter_window_msg_queue.h"
%include "nel/misc/keyboard_device.h"
%include "nel/misc/line.h"
%include "nel/misc/log.h"
%include "nel/misc/matrix.h"
%include "nel/misc/md5.h"
%include "nel/misc/mem_displayer.h"
%include "nel/misc/mem_stream.h"
%include "nel/misc/mouse_device.h"
%include "nel/misc/mouse_smoother.h"
%include "nel/misc/mutable_container.h"
%include "nel/misc/mutex.h"
%include "nel/misc/noise_value.h"
%include "nel/misc/o_xml.h"
%include "nel/misc/object_arena_allocator.h"
%include "nel/misc/object_vector.h"
%include "nel/misc/p_thread.h"
%include "nel/misc/path.h"
%include "nel/misc/plane.h"
%include "nel/misc/plane_inline.h"
%include "nel/misc/polygon.h"
%include "nel/misc/pool_memory.h"
%include "nel/misc/progress_callback.h"
%include "nel/misc/random.h"
%include "nel/misc/reader_writer.h"
%include "nel/misc/rect.h"
%include "nel/misc/report.h"
%include "nel/misc/resource_ptr.h"
%include "nel/misc/resource_ptr_inline.h"
%include "nel/misc/rgba.h"
%include "nel/misc/sha1.h"
%include "nel/misc/shared_memory.h"
%include "nel/misc/sheet_id.h"
%include "nel/misc/singleton.h"
%include "nel/misc/smart_ptr.h"
%include "nel/misc/smart_ptr_inline.h"
%include "nel/misc/speaker_listener.h"
%include "nel/misc/sstring.h"
%include "nel/misc/static_map.h"
%include "nel/misc/stl_block_allocator.h"
%include "nel/misc/stl_block_list.h"
%include "nel/misc/stop_watch.h"
%include "nel/misc/stream.h"
%include "nel/misc/stream_inline.h"
%include "nel/misc/string_common.h"
%include "nel/misc/string_conversion.h"
%include "nel/misc/string_id_array.h"
%include "nel/misc/string_mapper.h"
%include "nel/misc/string_stream.h"
%include "nel/misc/system_info.h"
%include "nel/misc/system_utils.h"
%include "nel/misc/task_manager.h"
%include "nel/misc/tds.h"
%include "nel/misc/thread.h"
%include "nel/misc/time_nl.h"
%include "nel/misc/timeout_assertion_thread.h"
%include "nel/misc/traits_nl.h"
%include "nel/misc/triangle.h"
%include "nel/misc/twin_map.h"
//%include "nel/misc/types_nl.h"
%include "nel/misc/ucstring.h"
%include "nel/misc/uv.h"
%include "nel/misc/value_smoother.h"
%include "nel/misc/variable.h"
%include "nel/misc/vector.h"
%include "nel/misc/vector_2d.h"
%include "nel/misc/vector_2f.h"
%include "nel/misc/vector_h.h"
%include "nel/misc/vector_inline.h"
%include "nel/misc/vectord.h"
%include "nel/misc/vectord_inline.h"
%include "nel/misc/win32_util.h"
%include "nel/misc/win_displayer.h"
%include "nel/misc/win_event_emitter.h"
%include "nel/misc/win_thread.h"
%include "nel/misc/win_tray.h"
%include "nel/misc/window_displayer.h"
%include "nel/misc/words_dictionary.h"
%include "nel/misc/xml_pack.h"


%template(CQuatT_Double) CQuatT<double>;
%template(CQuatT_Float) CQuatT<float>;
%template(CValueSmootherTemplate_Float) CValueSmootherTemplate<float>;
%template(Vector_String) std::vector<std::string>;
%template(Less_CString) std::less<NLMISC::CSString>;

